<template>
	<view class="content-wrap">
		<template v-if="list.length>0">
			<block v-for="(item,index) in list" :key="index">
				<m-section-item :types="1" :item="item"></m-section-item>
			</block> 
		</template>
		<tui-no-data imgUrl="/static/common/empty_icon.png" imgWidth="465" imgHeight="387" v-else>还没有数据哦~
		</tui-no-data>
	</view>
</template>

<script>
	import mSectionItem from "@/components/hq-ui/m-section-item"
	export default {
		components: {
			mSectionItem
		},
		data() {
			return {
				list: []
			};
		},
		onLoad() {
			this.loadList()
		},
		// 刷新
		async onPullDownRefresh() {
			this.loadList('refresh')
			await uni.stopPullDownRefresh();
		},
		methods: {
			// 加载列表
			loadList(source) {
				let that = this;
				let _params = {}
				that.$api.showLoading();
				that.$apis.approveList(_params).then(result => {
					that.$api.hideLoading();
					let _data = result;
					if (_data.code === 0) {
						if (source == 'refresh') {
							that.list = [];
						}
						that.list = _data.rows;
					}
				});
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #F4F8FB;
	}

	.content-wrap {
		width: 100%;
		padding: 24rpx;
	}
</style>